from sys import stdin
from fractions import gcd
import math

N, K = tuple(map(int, stdin.readline().split(' ')))
numbers = list(map(int, stdin.readline().strip().split(' ')))

i = 0
size = len(numbers)
while i < size:
    numbers[i] = gcd(K, numbers[i])
    i = i + 1

factors = []
half = int(math.ceil(math.sqrt(K)))
half = half + 1

i = 2
while i < half:
    x = K / i
    if i * x == K:
        factors.append(i)
        factors.append(x)
    i = i + 1
factors.append(K)
unique_factors = set(factors)
unique_numbers = set(numbers)

total = 0
for x in unique_factors:
    count = 1
    for y in unique_numbers:
        if(y % x == 0):
            count = 0
            break;
    total = total + count

print total
